#flash= flash[:error]
#content-title
  %h1 Create an Event
  %p Go ahead and type in the event details below
#event-listings
  .listings
    - form_for :event, @event, :url => (params[:series_id] ? series_events_url(@series)	 : events_url) do |form| 
      %table
        %tr
          %th Name:
          %td= form.text_field :name
          %td= error_message_on :event, :name
        %tr
          %th Place:
          %td= form.text_field :place
          %td= error_message_on :event, :place
        %tr
          %th Starting Time:
          %td= form.datetime_select("start_time",:default => 1.hour.from_now)
          %td= error_message_on :event, :start_time    
        %tr
          %td Optional Details:
        %tr
          %th Ending Time 
          %td= form.datetime_select("end_time",:default => 2.hours.from_now)
        %tr
          %td Cost:
          %td= form.text_field :cost
          %td= error_message_on :event, :cost
        %tr 
          %th Description:
          %td= form.text_area :description
          %td= error_message_on :event, :description
        %tr
          %th Category
          %td
            %select.categories{:name => "event[category_ids][]", :multiple => "multiple", :size => "10"}
              - @categories.each do |category|
                %option{:value => category.id}= category.name  
        %tr
          %th 
          %td Use ctrl or AppleKey to select multiple values
      = submit_tag 'Save'
